/*
 * @Author: yanjinzhong
 * @Date: 2021-04-12 19:01:15
 * @Description: file content
 */
import crud from './crud';
export const tableColumns = (data?: any) => {
  const garbageTable = [
    {
      dataIndex: 'custCode',
      title: '客户代码',
      align: 'center',
      fixed: 'left',
      width: 110,
      customRender: ({ text }: { text: string }) => text,
    },
    {
      dataIndex: 'meterCode',
      title: '水表号',
      width: 150,
      align: 'center',
      customRender: ({ text }: { text: string }) => {
        return text;
      },
    },
    {
      dataIndex: 'custName',
      title: '客户名称',
      width: 110,
      ellipsis: true,
      align: 'center',
    },
    {
      dataIndex: 'custDetailAddress',
      title: '客户地址',
      ellipsis: true,
      width: 200,
      align: 'center',
    },
    {
      dataIndex: 'status',
      title: '客户状态',
      width: 110,
      align: 'center',
    },
    {
      dataIndex: 'contactsName',
      title: '联系人',
      width: 110,
      align: 'center',
    },
    {
      dataIndex: 'contactsPhone',
      title: '联系电话',
      width: 150,
      align: 'center',
    },
    {
      dataIndex: 'action',
      key: 'action',
      title: '操作',
      align: 'center',
      customRender: ({ record }: { record: any }) => {
        return crud({ ...data, record });
      },
      fixed: 'right',
    },
  ];

  return {
    garbageTable,
  };
};
